#! /bin/sh

# Build Open Container Initiative (OCI) container image suitable as a base for
# shell-based workloads. This adds FreeBSD-runtime, FreeBSD-pkg-bootstrap and a
# handful of others packages to create a small image which can be easily
# extended by installing packages.

OCI_BASE_IMAGE=dynamic

oci_image_build() {
	set_cmd ${workdir} /bin/sh
	# The static image installed termcap.small into /usr/share/misc/termcap
	# and we are replacing it with the full termcap file. We remove the
	# small one first to avoid creating a .pkgsave file.
	rm ${workdir}/rootfs/usr/share/misc/termcap
	install_packages ${abi} ${workdir} \
			 FreeBSD-runtime \
			 FreeBSD-certctl \
			 FreeBSD-kerberos-lib \
			 FreeBSD-libarchive \
			 FreeBSD-libexecinfo \
			 FreeBSD-libucl \
			 FreeBSD-fetch \
			 FreeBSD-rc \
			 FreeBSD-pkg-bootstrap \
			 FreeBSD-mtree
}
